<template>
  <div>
    <table>
      <tr>
        <td>id</td>
        <td>name</td>
        <td>passwd</td>
      </tr>
      <tr v-for="i in books">
        <td>{{i.id}}</td>
        <td>{{i.name}}</td>
        <td>{{i.passwd}}</td>
      </tr>
    </table>

  </div>
</template>

<script>
export default {
  name: "Book",
  data(){
    return {
      msg: "hello world",
      books: [
        {
          id: 1,
          name: "root",
          passwd: 'dxy2007'
        },
        {
          id: 2,
          name: 'daxingyi',
          passwd: "daxingyi2007"
        }
      ]
    }
  },
  created() {
    const _this = this
    axios.get('http://localhost:8888/findAll').then(function (resp){
      console.log(resp)
      _this.books = resp.data
    })
  }
}
</script>

<style scoped>

</style>